package mainControls;

import smallTools.SimpleTime;
import entities.Course;
import entities.Section;

public class LectureChecker {

	public boolean check(Section theSection, Course theCourse,
			SimpleTime startTimeCandidate) {
		String[] strLectures = theCourse.getAllLecture();
		for (String lectureId : strLectures) {
			Section lectureNow = Section.getSectionById(lectureId);
			SimpleTime startTimeNow = lectureNow.getSectionStartTime();
			int durationNow = lectureNow.getSectionDuration();
			if (startTimeNow != null) {
				if (SimpleTime.areSectionsConflicted(startTimeNow, durationNow,
						startTimeCandidate, theSection.getSectionDuration()) == true)
					return false;
			}
		}
		return true;
	}

}
